const alova = require("alova");
import { useSSE } from 'alova/client';
const postMethodHandler = (value: string) => alova.Post('/api/source', null, {
    headers: { 'Content-Type': 'application/json' },
    param: { key: value }
});
const { data, eventSource, readyState,   onOpen,   onMessage, onError,   on,   send, close,   eventSource  } = useSSE(postMethodHandler, {
    credentials: 'include',
    initialData: 'initial-data',// 初始时 data 中的数据
    immediate:true,
  });